# Contributor: John Regan <john@jrjrtech.com>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=execline
pkgver=2.9.4.0
pkgrel=0
pkgdesc="A small scripting language, to be used in place of a shell in non-interactive scripts."
url=https://skarnet.org/software/execline/
arch="all"
license="ISC"
options="!check"
makedepends="skalibs-dev>=2.14"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://skarnet.org/software/execline/execline-$pkgver.tar.gz"

build() {
	./configure \
		--enable-shared \
		--enable-static \
		--disable-allstatic \
		--libdir=/usr/lib \
		--with-dynlib=/lib \
		--enable-multicall
	make
}

package() {
	make DESTDIR="$pkgdir" install
	# Compat symlink for #!/usr/bin/execlineb shebangs, remove if usrmerge
	mkdir -p "$pkgdir/usr/bin"
	ln -s ../../bin/execlineb "$pkgdir/usr/bin/execlineb"
}

doc() {
	default_doc
	mkdir -p "$subpkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$subpkgdir/usr/share/doc/$pkgname"
}

static() {
	default_static
	rmdir -p "$pkgdir"/usr/lib || :
}

sha512sums="
11d96863d2f90abc371656e17bac9fd83f1303337444db5a1f24e8a02cab654a3b5e9081af130d5cbca5a4f6ea5cf5f6c2affa66e2b4a9eb39c20410efeb8795  execline-2.9.4.0.tar.gz
"
